using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MsdnVideo
{
    public partial class DevolverForm : PlantillaForm 
    {
        public DevolverForm()
        {
            InitializeComponent();
        }

        private void DevolverForm_Load(object sender, EventArgs e)
        {
            this.alquileresTableAdapter.FillByPendientes(this.alquilersDS.Alquileres);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            
        }

        private void Cancelar_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void Devolver_Click(object sender, EventArgs e)
        {
            AlquilersDS.AlquileresRow rowAlquileres;
            foreach (DataGridViewRow fila in alquileresDataGridView.SelectedRows)
            {
                rowAlquileres = (AlquilersDS.AlquileresRow)alquilersDS.Alquileres[fila.Index];

                PeliculasCN peliculasCN = new PeliculasCN();
                peliculasCN.DevolverPelicula(rowAlquileres);
            }
            Close();
        }  
    }
}